package com.qianfeng.zhangwei.xutils.bean;

import android.database.Cursor;

import com.lidroid.xutils.db.annotation.Column;
import com.lidroid.xutils.db.annotation.Id;
import com.lidroid.xutils.db.annotation.Table;
import com.lidroid.xutils.db.annotation.Transient;
import com.qianfeng.zhangwei.xutils.db.DbHelper;

/**
 * @说 明：
 * @项目名称：Sz1504Adv
 * @包 名： com.qianfeng.zhangwei.xutils.bean
 * @类 名： User
 * @创 建人： zhangwei
 * @创建时间：2015-08-04 15:39
 * @版 本：v1.0
 * @修 改人：
 * @修改时间：
 * @修改备注：
 */


@Table(name = "TB_USER")
public class User {
    @Id
    private long id;

    @Column(column = "USER_ID")
    private String userId;
    @Column(column = "NAME")
    private String name;
    @Column(column = "PSW",defaultValue = "1504")
    private String psw;
    @Transient
    private int num;



    public User() {
    }

    public User(Cursor cursor) {
        this.id = cursor.getLong(cursor.getColumnIndex(DbHelper.DbUser.id));
        this.userId = cursor.getString(cursor.getColumnIndex(DbHelper.DbUser.userId));
        this.name = cursor.getString(cursor.getColumnIndex(DbHelper.DbUser.name));
        this.psw = cursor.getString(cursor.getColumnIndex(DbHelper.DbUser.psw));
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPsw() {
        return psw;
    }

    public void setPsw(String psw) {
        this.psw = psw;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", userId='" + userId + '\'' +
                ", name='" + name + '\'' +
                ", psw='" + psw + '\'' +
                '}';
    }
}
